<%@ page import="com.dzxcqmxm.JB.Album" %>
<%@ page import="com.dzxcqmxm.Dao.AlbumDao" %>
<%@ page import="com.dzxcqmxm.Dao.impl.AlbumDaoImpl" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: Payboi
  Date: 2022/6/3
  Time: 14:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <style>
        .left{
            width: 88%;
            height: 600px;
            background-color: #BDFDF0;
            float: left;

        }
        .right{
            width: 12%;
            height: 400px;
            background-color: #ADFCEC;
            float: left;
            padding-top: 200px;
        }
        .bt{

            background-color: rgba(155, 243, 236, 0.76);
            width: 100%;
            border-style: hidden;
            border-color: #C4E6D8;
        }
        .in{
            background-color: rgba(212, 241, 239, 0.77);
            width: 100%;
            border-style: double;
            border-color: #80F6DE;
        }
        img{
            width: 100px;
        }
        .album{
            float:left;
            width: 102px;
            /*设置文本居中就对了！！*/
            text-align:center;
        }
    </style>
</head>
<body>
<%

    /**
     * 将a设为全局变量好了，会很方便，
     * 然后发现并不行，就离谱
     */
%>
<div>
    <div class="left">
        <h1>这里是展示用户自己新建的相册的页面</h1>
        <%--准备展示相册--%>
        <%
            AlbumDao albumDao = new AlbumDaoImpl();
            ArrayList<Album> albumArrayList = new ArrayList<Album>();
            /**
             * 获取servlet页面中的session参数
             */
            albumArrayList = (ArrayList<Album>) session.getAttribute("albumArrayList");
            System.out.println("测试一下再yhContent页面的albumArrayList"+albumArrayList);
            if(albumArrayList!=null&&albumArrayList.size()>0){
                for(Album album :albumArrayList){
                    %>
        <div class="album">
            <img src="../img/album.png">
            <p><%
                    out.println("<tr><td><a href='/dzxc/findPhotoByUserNameAndAlbumUrlServlet?AlbumUrl="+album.getAlbumUrl()+"&XTXCName="+album.getXTXCName()+"&AlbumName="+album.getAlbumName()+ "'>" +
                            album.getAlbumName() +
                            "</a></td></tr><br><br>");
                    %></p>
        </div>
                    <%
                }
            }
            %>


    </div>
    <div class="right">
        <form action="/dzxc/addAlbumServlet" method="post">
            <% //获取展示相册页面传过来的参数
                String XTXCName = (String) request.getSession ().getAttribute ("XTXCName");
                //并且再次设立给增加页面用
                request.getSession().setAttribute("XTXCName", XTXCName);
            %>

            <input class="in" type="text" name="AlbumName"/>
            <input class="bt" type="submit" value="新建相册"/>
        </form>
        <form method="post" action="/dzxc/delAlbumServlet">
            <% //获取展示相册页面传过来的参数
                String XTXCName1 = (String) request.getSession ().getAttribute ("XTXCName");
                //并且再次设立给删除页面用
                request.getSession().setAttribute("XTXCName", XTXCName1);
            %>
            <input class="in" type="text" name="AlbumName"/>
            <input class="bt" type="submit" value="删除相册"/>
        </form>
        <form method="post" action="/dzxc/updateAlbumNameServlet">
            <input class="in" type="text" name="AlbumName"/>
            <input class="in" type="text" name="AlbumBaoMi"/>
            <input class="bt" type="submit" value="保密性"/>
        </form>
    </div>
</div>


</body>
</html>
